
package com.tanhua.test;

import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.tea.*;
import com.aliyun.teaopenapi.models.Config;

public class SmsTest01 {


    public static void main(String[] args_) throws Exception {
        Config config = new Config()
                .setAccessKeyId("LTAI5tP6qcdBskizpnLDrpuY")
                .setAccessKeySecret("u0IjHdxLBwgafDPJTZm3uSvbDIVIjj");
        config.endpoint = "dysmsapi.aliyuncs.com";
        Client client = new Client(config);


        SendSmsRequest sendSmsRequest = new SendSmsRequest()
                .setSignName("阿里云短信测试")
                .setTemplateCode("SMS_154950909")
                .setPhoneNumbers("17602128959")
                .setTemplateParam("{\"code\":\"1234\"}");
        client.sendSms(sendSmsRequest);
        System.out.println("ok");
    }
}